package cn.ilovese.collect.vo.task;

import cn.ilovese.collect.po.task.Task;
import cn.ilovese.collect.vo.Device.DeviceRequirementVO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

@Data
public class TaskRecommendVO {
    private Integer id;

    private String taskname;

    private Double matchity;

    private String username;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date deadline;

    private Integer need_num;

    private Integer total_num;

    private String type;

    private String environment;

    private DeviceRequirementVO deviceRequirement;

    private Boolean capableToClaim;

    private Integer reportPrice;

    public TaskRecommendVO(){

    }

    public TaskRecommendVO(Task task, String username){
        this.username=username;
        this.id=task.getId();
        this.taskname=task.getTaskName();
        this.deadline=task.getEndTime();
        this.type=task.getType();
        this.need_num=task.getNeedNumber();
        this.total_num=task.getTotalNumber();
        this.environment=task.getEnvironment();
        this.reportPrice=task.getReportPrice();
    }

    public TaskRecommendVO(TaskRecommendVO task){
        this.username=task.getUsername();
        this.id=task.getId();
        this.taskname=task.getTaskname();
        this.deadline=task.getDeadline();
        this.type=task.getType();
        this.need_num=task.getNeed_num();
        this.total_num=task.getTotal_num();
        this.environment=task.getEnvironment();
        this.reportPrice=task.getReportPrice();
    }
}